//本文件填写Fight-Rogue-每月战斗事件执行周期内相关阶段函数
//【记得经常使用 Ctrl+S 保存修改，只有保存以后才能在编辑事件时生效】
//可引用变量 ArgBox - 该事件从上层事件继承的参数盒子

/// <summary>
/// 在此区域填写自定义的using指令
/// 注意：一般事件制作不需要填写; 在你明确知道每个using指令的意义和有明确使用需求的情况下再填写此指令集
/// </summary>
#region CustomUsings

class RogueEnemy
{
	private static List<short> _gameProgressToEnemy = new List<short> {
		Config.Character.DefKey.BambooGloveWoodenMan,
		Config.Character.DefKey.Monkey0,
		Config.Character.DefKey.SickBeggar,
		Config.Character.DefKey.Snake0,
		Config.Character.DefKey.Huanxin, //

		Config.Character.DefKey.ShaolinTraitor,
		Config.Character.DefKey.JieqingTraitor,
		Config.Character.DefKey.FulongTraitor,
		Config.Character.DefKey.ZhujianTraitor,
		Config.Character.DefKey.Monv0, //

		Config.Character.DefKey.FoxyGirl,
		Config.Character.DefKey.DevilishWoman,
		Config.Character.DefKey.PoisonousWidow,
		Config.Character.DefKey.HappyReunionFairy,
		Config.Character.DefKey.DayueYaochang1,
		
		Config.Character.DefKey.GhostServant,
		Config.Character.DefKey.BaihuaMember2,
		Config.Character.DefKey.EmeiMember2,
		Config.Character.DefKey.XiangshuMinion2,
		Config.Character.DefKey.Jiuhan2,

		Config.Character.DefKey.GhostServant,
		Config.Character.DefKey.FulongMember3,
		Config.Character.DefKey.EmeiMember3,
		Config.Character.DefKey.XiangshuMinion3,
		Config.Character.DefKey.JinHuanger3,

		Config.Character.DefKey.JingangMember4,
		Config.Character.DefKey.BaihuaMember4,
		Config.Character.DefKey.WudangMember4,
		Config.Character.DefKey.XiangshuMinion4,
		Config.Character.DefKey.YiYihou4,
		
		Config.Character.DefKey.WuxianMember5,
		Config.Character.DefKey.JieqingMember5,
		Config.Character.DefKey.FulongMember5,
		Config.Character.DefKey.XuehouMember5,
		Config.Character.DefKey.WeiQi5,
		
		Config.Character.DefKey.Righteous6,
		Config.Character.DefKey.ShaolinMember6,
		Config.Character.DefKey.BaihuaMember6,
		Config.Character.DefKey.XiangshuMinion6,
		Config.Character.DefKey.Yixiang6,
		
		Config.Character.DefKey.WudangRetiredSenior,
		Config.Character.DefKey.RanshanRetiredSenior,
		Config.Character.DefKey.XuannvRetiredSenior,
		Config.Character.DefKey.ZhujianRetiredSenior,
		Config.Character.DefKey.Xuefeng7,
		
		Config.Character.DefKey.KongsangRetiredSenior,
		Config.Character.DefKey.JieqingRetiredSenior,
		Config.Character.DefKey.XuehouRetiredSenior,
		Config.Character.DefKey.XiangshuMinion8,
		Config.Character.DefKey.ShuFang8,

		Config.Character.DefKey.TrappedHuanxin,
	};
	public static short GetEnemy(int progress) {
		return _gameProgressToEnemy[progress - 100];
	}
}


#endregion

/// <summary>
/// 该事件监听的触发点被触发后，该接口检测事件是否满足执行条件，如果不满足则不执行该事件
/// </summary>
/// <returns>true - 可以执行 false - 忽略触发不执行</returns>
public override bool OnCheckEventCondition()
{
	//TODO
	return true;
}

/// <summary>
/// 该事件被触发且满足执行条件，事件显示前调用
/// 一般用于向参数盒子中准备事件链需要用到的参数
/// </summary>
public override void OnEventEnter()
{
	//TODOOldWoodenMan
	// EventHelper.TemporarilyModifyExtraNeili(ArgBox.GetCharacter("RoleTaiwu"), GameData.Domains.DomainManager.World.GetMainStoryLineProgress());
	// EventHelper.TemporarilyModifyCurrNeili(ArgBox.GetCharacter("RoleTaiwu"), GameData.Domains.DomainManager.World.GetMainStoryLineProgress());
	// int enemyId= EventHelper.GetOrCreateFixedCharacterByTemplateId(Config.Character.DefKey.OldWoodenMan).GetId();
	// var enemyId=EventHelper.CreateNonIntelligentCharacter(Config.Character.DefKey.SickBeggar);
	var enemyId=EventHelper.CreateNonIntelligentCharacter(RogueEnemy.GetEnemy(GameData.Domains.DomainManager.World.GetMainStoryLineProgress()));
	// int enemyId= EventHelper.GetOrCreateFixedCharacterByTemplateId(Config.Character.DefKey.Huanxin).GetId();
	ArgBox.Set("Enemy", enemyId);
}

/// <summary>
/// 该事件执行完毕，即将退出该事件时调用
/// 一般用于从参数盒子中移除事件链中不需要用到的参数，或记录事件触发月份，确保后续触发几率计算
/// </summary>
public override void OnEventExit()
{
	//
	var taiwu = ArgBox.GetCharacter("RoleTaiwu");
	var context = GameData.Domains.DomainManager.TaiwuEvent.MainThreadDataContext;
	var progress = GameData.Domains.DomainManager.World.GetMainStoryLineProgress();
	var level = (progress - 100) / 5 + 1;
	var neiliIncremental = 200 * level;
	var expIncremental = 2000 * level;

	taiwu.SetExtraNeili(taiwu.GetExtraNeili() + neiliIncremental, context);
	taiwu.SetCurrNeili(taiwu.GetCurrNeili() + neiliIncremental, context);

	EventHelper.ChangeRoleExp(taiwu, expIncremental);
	//TODO
	GameData.Domains.DomainManager.World.SetMainStoryLineProgress(
		(short)(progress + 1),
		GameData.Domains.DomainManager.TaiwuEvent.MainThreadDataContext
	);
}

/// <summary>
/// 该事件即将显示前调用,获取被替换占位符后的事件显示内容
/// 如果事件文本预设满足系统默认的占位符替换方案，则可以不填写此接口
/// </summary>
public override string GetReplacedContentString()
{
	//TODO
	return string.Empty;
}

/// <summary>
/// 获取额外格式化使用的多语言字段
/// </summary>
/// <returns></returns>
public override List<string> GetExtraFormatLanguageKeys()
{
    return default;
}